clear
clear matrix
program drop _all

capture log close

cd D:\Projects\TakingtheStreets\Replication			/*Provide appropriate directory information to run the file on your machine*/

log using Logs\GrauvogelLichtVonSoest2016Replication2_5_24_16.log, append



set more off
set matsize 1000
set scheme s1mono


*PURPOSE:	This file replicates the robustness checks, residuals analysis, and 
*			bivariate probit analyses reported in the online appendix for Grauvogel,
*			Licht, and von Soest, 2016, "Sanctions and Signals". The program was 
*			written for Stata 13. If run through completely, this will replicate all
*			tables and figures in the online appendix, EXCEPT for Fig A3, Table A11,
*			Table A12. These three exceptions are replicated in the first do-file, 
*			GrauvogelLichtVonSoest2016Replication.do. 
*INSTRUCTIONS:		For smooth operation, be sure to accurately 
*					designate a directory in the <cd> command above. Create  
*					subfolders with the following exact titles in the directory 
*					location:  Logs, Tables, Graphs, and Data. Save the file named
*					GrauvogelLichtVonSoestReplication.dta in the Data folder. The
*					simulation used to produce Fig A9 may take quite a long time
*					to complete, especialy if your machine is procesisng other
*					tasks. For this reason, the portion of the do-file with
*					the simulation and graphing commands has been commented out. 
*					If you wish to run the simulation and produce the simulated
*					sampling distribution of the quantities of interest, simply
*					delete the /* */ bracketing the end of the do-file.	  	 
*AUTHOR:	Amanda A. Licht, Binghamton University
*MACHINE:	LICHTBINGOFFICE, Lenovo ThinkStation running StataMP 13
*DATE:		5/24/2016	
*MODIFIED:		
*FILE:		GrauvogelLichtVonSoest2016Replication2.do
*LOG:		GrauvogelLichtVonSoest2016Replication2_MO_DY_YR.log
*DATA:		GrauvogelLichtVonSoestReplication.dta.dta
*SOURCES:	Protest and Response, Regan 2012
*			Mass Mobilization, phase 2, Clark 2014
*			UCDP/PRIO Armed Conflict v4.0, Themner and Wallensteen 2013
*			COW Formal Alliances v4.1, Gibler 2009
*			Trade Data v3.0, Barbieri and Keshk 2012
*			IGO memberships v2.3, Pevehouse, Nordstrom and Warnke 2004
*			Geddes Autocratic Regimes, Geddes, Wright and Frantz 2013
*			PolityIV Jaggers and Gurr 2012
*			IAEP, Regan and Clark 2013
*			Freedom of the Press, Freedom House 2013
*			CIRI, Cingranelli and Richards 2012
*			Political Terror Scale, Gibney and Wood 2012
*OUTPUT:
*	Data:	GL&vS_Pdiffs_IVs.dta	- control variables from bivariate probit at
*									mean and modal values 
*			GL&vS_pdiffs.dta		- simulated sampling distribution of probabilities
*									and differences therein from the bivariate probit
*									reported as Table A17
*			GL&vS_pdiffs_CIs.dta	- median, 2.5th and 97.5th percentile of the QIs
*									described above
*	Graphs:	FigA1		- Histogram of dependent variable in fixed-effects
*						sample
*			FigA2		- Histogram of dependent variable in ZINB sample
*			FigA4		- Raw within-year autocorrelation in Counts of Protests
*			FigA5		- Autocorrelation between residuals after Poisson regression
*			FigA6		- Autocorrelation between residuals after Poisson w/country 
*						fixed effects
*			FigA7		- Autocorrelation between residuals after POisson w/country 
*						and select time fixed effects
*			FigA8		- Difference in Residuals' correlaitons |w/lagged DV|- |w/o lagged DV|
*	Tables:	Table A1	- Summary of within and between variance
*			Table A2-A9	- cross tabs of types of sanctions
*			Table A10	- tabulation of dependent variable
*			Table A13 	- ZINB using alternative conceptualization
*						of sanctions that excludes any instance 
*						where the target is only under trade or 
*						environmental sanctions
*			Table A14	- fixed effect Poisson models using alt.
*						conceptualization of sanctions as above.
*						Together, A13 and A14 provide the information
*						summarized in Table 2 of the main text.									
*			Table A15 	- aka Table 3 of main text. Fixed effect Poisson 
*						models estimated on subsamples by regime type,
*						using democracy/anocracy/autocracy based on
*						cutpoints of +/- 6 on polity2 scale
*			TableA16	- dummy variable Poisson, i.e. manually entered 
*						country fixed effects
*			TableA17	- bivariate probit of Increase or Decrease in count
*						of protests

*****************************************
*PRELIMINARIES:
*****************************************

*open replication dataset:
use Data/GrauvogelLichtVonSoestReplication.dta, clear
	des

*Declare data to be time-series cross-sectional:
	xtset targetstate yearmonth

*Table A1:  summary of within and between variance
	xtsum
	
*Table A2-A9:  Cross-tabluations of sanction types

tab threat_thisobs threat_thisobs_notrade
tab imposition_thisobs imposition_thisobs_notrade	
tab threaton HumanRightsSanction
tab sanctionon HumanRightsSanction
tab threaton multisender_bin
tab sanctionon multisender_bin
tab threaton NarrowSanction_bin
tab sanctionon NarrowSanction_bin

*Fig A1:
#delimit ;
hist MonthlyEventsThatCount if FEsample==1, width(1) 
	title("Fig A1. Distribution of Antigovernment Protests in Fixed Effects Sample", size(medium))
	name(figa1, replace)
	saving(Graphs/FigA1.gph, replace);
	
hist MonthlyEventsThatCount if ZINBsample==1, width(1)	
	title("Fig A2. Distribution of Antigovernment Protests in ZINB Sample", size(medium))
	name(figa2, replace)
	saving(Graphs/FigA2.gph, replace);
	#delimit cr
	
	*Table A10: tab of anti-government protests in FE sample:
	tab MonthlyEventsThatCount if FEsample==1
	

********************************************
*ROBUSTNESS CHECKS:Tables 2 and 3, A13-A15
********************************************

*1) Alernative conceptualization of sanctions:

*ZINB:	
set more off															
#delimit ;
zinb MonthlyEventsThatCount threat_thisobs_notrade 
		imposition_thisobs_notrade 
		HumanRightsSanction 
		NarrowSanction_bin_notrade 
		multisender_bin_notrade 
		threaton_notrade 
		sanctionon_notrade
		Loverallglobalizationindex
		politynorm 
		politynorm_sq
		physint
		FOTP_Free 
		FOTP_PFree 	
		Llpop
		LAtrocity
		Increase_stateviolence 
		Increase_stateaccom 
		Decrease_stateviolence 
		Decrease_stateaccom 
		L1MonthlyEventsThatCount, 
	inflate(HumanRightsSanction 
		NarrowSanction_bin_notrade 
		multisender_bin_notrade
		threaton_notrade 
		sanctionon_notrade
		Loverallglobalizationindex
		politynorm 
		politynorm_sq
		physint
		FOTP_Free 
		FOTP_PFree
		Llpop
		Llrealgdp
		L1MonthlyEventsThatCount) 
vce(cluster targetstate);
#delimit cr

*Run lincom commands for the implicit interactions:
lincom threaton_notrade + HumanRightsSanction	
	local cc1 = round(r(estimate), .001)
	local se1 = round(r(se), .001)
	
lincom threaton_notrade + NarrowSanction_bin_notrade
	local cc2 = round(r(estimate), .001)
	local se2 = round(r(se), .001)

lincom threaton_notrade + multisender_bin_notrade
	local cc3 = round(r(estimate), .001)
	local se3 = round(r(se), .001)

lincom sanctionon_notrade + HumanRightsSanction	
	local cc4 = round(r(estimate), .001)
	local se4 = round(r(se), .001)
	
lincom sanctionon_notrade + NarrowSanction_bin_notrade
	local cc5 = round(r(estimate), .001)
	local se5 = round(r(se), .001)

lincom sanctionon_notrade + multisender_bin_notrade
	local cc6 = round(r(estimate), .001)
	local se6 = round(r(se), .001)
	
#delimit ;
outreg2 using "Tables\TableA13.txt", text  replace
		stats(coef se) aster(coef) sym(***,**,*) cti(ZINB)
		e(N N_zero N_clust ll chi2)
		addtext("Other Threats + HR, `cc1'(`se1')" 
			"Other Threats + Narrow, `cc2'(`se2')"
			"Other Threats + Mult, `cc3'(`se3')"
			"Other Imposed + HR, `cc4'(`se4')"
			"Other Imposed + Narrow, `cc5'(`se5')"
			"Other Imposed + Multi, `cc6'(`se6')");
#delimit cr		


*Fixed Effects Poisson:
#delimit ;
xtpoisson MonthlyEventsThatCount 
		threat_thisobs_notrade 
		imposition_thisobs_notrade 
		HumanRightsSanction 
		NarrowSanction_bin_notrade 
		multisender_bin_notrade 
		threaton_notrade 
		sanctionon_notrade
		Loverallglobalizationindex
		politynorm 
		politynorm_sq
		physint
		FOTP_Free 
		FOTP_PFree 	
		Llpop
		LAtrocity
		Increase_stateviolence 
		Increase_stateaccom 
		Decrease_stateviolence 
		Decrease_stateaccom 
		, fe vce(robust);
#delimit cr	
lincom threaton_notrade + HumanRightsSanction	
	local cc1 = round(r(estimate), .001)
	local se1 = round(r(se), .001)
	
lincom threaton_notrade + NarrowSanction_bin_notrade
	local cc2 = round(r(estimate), .001)
	local se2 = round(r(se), .001)

lincom threaton_notrade + multisender_bin_notrade
	local cc3 = round(r(estimate), .001)
	local se3 = round(r(se), .001)

lincom sanctionon_notrade + HumanRightsSanction	
	local cc4 = round(r(estimate), .001)
	local se4 = round(r(se), .001)
	
lincom sanctionon_notrade + NarrowSanction_bin_notrade
	local cc5 = round(r(estimate), .001)
	local se5 = round(r(se), .001)

lincom sanctionon_notrade + multisender_bin_notrade
	local cc6 = round(r(estimate), .001)
	local se6 = round(r(se), .001)
	
#delimit ;
outreg2 using "Tables\TableA14.txt", text  replace
		stats(coef se) aster(coef) sym(***,**,*) cti(FE Poisson)
		e(N N_g ll chi2)
		addtext("Other Threats + HR, `cc1'(`se1')" 
			"Other Threats + Narrow, `cc2'(`se2')"
			"Other Threats + Mult, `cc3'(`se3')"
			"Other Imposed + HR, `cc4'(`se4')"
			"Other Imposed + Narrow, `cc5'(`se5')"
			"Other Imposed + Multi, `cc6'(`se6')");
#delimit cr		



*Fixed Effects Poisson w/Time Dummies:
#delimit ;
xtpoisson MonthlyEventsThatCount 
		threat_thisobs_notrade 
		imposition_thisobs_notrade 
		HumanRightsSanction 
		NarrowSanction_bin_notrade 
		multisender_bin_notrade 
		threaton_notrade 
		sanctionon_notrade
		Loverallglobalizationindex
		politynorm 
		politynorm_sq
		physint
		FOTP_Free 
		FOTP_PFree 	
		Llpop
		LAtrocity
		Increase_stateviolence 
		Increase_stateaccom 
		Decrease_stateviolence 
		Decrease_stateaccom 
		 _1992 
		 _1996 
		 _2000 
		 _2001 
		 _2004, fe vce(robust);
#delimit cr	
lincom threaton_notrade + HumanRightsSanction	
	local cc1 = round(r(estimate), .001)
	local se1 = round(r(se), .001)
	
lincom threaton_notrade + NarrowSanction_bin_notrade
	local cc2 = round(r(estimate), .001)
	local se2 = round(r(se), .001)

lincom threaton_notrade + multisender_bin_notrade
	local cc3 = round(r(estimate), .001)
	local se3 = round(r(se), .001)

lincom sanctionon_notrade + HumanRightsSanction	
	local cc4 = round(r(estimate), .001)
	local se4 = round(r(se), .001)
	
lincom sanctionon_notrade + NarrowSanction_bin_notrade
	local cc5 = round(r(estimate), .001)
	local se5 = round(r(se), .001)

lincom sanctionon_notrade + multisender_bin_notrade
	local cc6 = round(r(estimate), .001)
	local se6 = round(r(se), .001)
	
#delimit ;
outreg2 using "Tables\TableA14.txt", text  append
		stats(coef se) aster(coef) sym(***,**,*) cti(FE Poisson w/Time Dummies)
		e(N N_g ll chi2)
		addtext("Other Threats + HR, `cc1'(`se1')" 
			"Other Threats + Narrow, `cc2'(`se2')"
			"Other Threats + Mult, `cc3'(`se3')"
			"Other Imposed + HR, `cc4'(`se4')"
			"Other Imposed + Narrow, `cc5'(`se5')"
			"Other Imposed + Multi, `cc6'(`se6')");
#delimit cr		


*Fixed Effects Poisson w/Lagged DV:
#delimit ;
xtpoisson MonthlyEventsThatCount 
		threat_thisobs_notrade 
		imposition_thisobs_notrade 
		HumanRightsSanction 
		NarrowSanction_bin_notrade 
		multisender_bin_notrade 
		threaton_notrade 
		sanctionon_notrade
		Loverallglobalizationindex
		politynorm 
		politynorm_sq
		physint
		FOTP_Free 
		FOTP_PFree 	
		Llpop
		LAtrocity
		Increase_stateviolence 
		Increase_stateaccom 
		Decrease_stateviolence 
		Decrease_stateaccom 
		L1MonthlyEventsThatCount, fe vce(robust);
#delimit cr	
lincom threaton_notrade + HumanRightsSanction	
	local cc1 = round(r(estimate), .001)
	local se1 = round(r(se), .001)
	
lincom threaton_notrade + NarrowSanction_bin_notrade
	local cc2 = round(r(estimate), .001)
	local se2 = round(r(se), .001)

lincom threaton_notrade + multisender_bin_notrade
	local cc3 = round(r(estimate), .001)
	local se3 = round(r(se), .001)

lincom sanctionon_notrade + HumanRightsSanction	
	local cc4 = round(r(estimate), .001)
	local se4 = round(r(se), .001)
	
lincom sanctionon_notrade + NarrowSanction_bin_notrade
	local cc5 = round(r(estimate), .001)
	local se5 = round(r(se), .001)

lincom sanctionon_notrade + multisender_bin_notrade
	local cc6 = round(r(estimate), .001)
	local se6 = round(r(se), .001)
	
#delimit ;
outreg2 using "Tables\TableA14.txt", text  append
		stats(coef se) aster(coef) sym(***,**,*) cti(FE Poisson w/Lagged DV)
		e(N N_g ll chi2)
		addtext("Other Threats + HR, `cc1'(`se1')" 
			"Other Threats + Narrow, `cc2'(`se2')"
			"Other Threats + Mult, `cc3'(`se3')"
			"Other Imposed + HR, `cc4'(`se4')"
			"Other Imposed + Narrow, `cc5'(`se5')"
			"Other Imposed + Multi, `cc6'(`se6')");
#delimit cr		


*2) By regime types:

tab1 democracy autocracy anocracy

*we need to remove some of these variables when estimating inside the
*regime types due to lack of variation:
bysort democracy:  sum physint politynorm  
tab1 FOTP_Free FOTP_PFree FOTP_NFree LAtrocity if democracy==1

*FE Poisson:  Democracies
#delimit ;
xtpois	MonthlyEventsThatCount threat_thisobs  
		imposition_thisobs  
		HumanRightsSanction 
		NarrowSanction_bin 
		multisender_bin 
		threaton  
		sanctionon 
		Loverallglobalizationindex
		politynorm 
		physint
		FOTP_NFree 
		FOTP_PFree 	
		Llpop
		LAtrocity
		Increase_stateviolence 
		Increase_stateaccom 
		Decrease_stateviolence 
		Decrease_stateaccom 
		if democracy==1, fe vce(robust);
#delimit cr
		
*Run lincom commands for the implicit interactions:
lincom threaton  + HumanRightsSanction	
	local cc1 = round(r(estimate), .001)
	local se1 = round(r(se), .001)
	
lincom threaton  + NarrowSanction_bin
	local cc2 = round(r(estimate), .001)
	local se2 = round(r(se), .001)

lincom threaton  + multisender_bin
	local cc3 = round(r(estimate), .001)
	local se3 = round(r(se), .001)

lincom sanctionon  + HumanRightsSanction	
	local cc4 = round(r(estimate), .001)
	local se4 = round(r(se), .001)
	
lincom sanctionon  + NarrowSanction_bin
	local cc5 = round(r(estimate), .001)
	local se5 = round(r(se), .001)

lincom sanctionon  + multisender_bin
	local cc6 = round(r(estimate), .001)
	local se6 = round(r(se), .001)
	
#delimit ;
outreg2 using "Tables\TableA15.txt", text  replace
		stats(coef se) aster(coef) sym(***,**,*) cti(Democracy)
		e(N N_g ll chi2)
		addtext("Other Threats + HR, `cc1'(`se1')" 
			"Other Threats + Narrow, `cc2'(`se2')"
			"Other Threats + Mult, `cc3'(`se3')"
			"Other Imposed + HR, `cc4'(`se4')"
			"Other Imposed + Narrow, `cc5'(`se5')"
			"Other Imposed + Multi, `cc6'(`se6')");
#delimit cr		


*FE Poisson:  anocracies
#delimit ;
xtpois	MonthlyEventsThatCount threat_thisobs  
		imposition_thisobs  
		HumanRightsSanction 
		NarrowSanction_bin 
		multisender_bin 
		threaton  
		sanctionon 
		Loverallglobalizationindex
		politynorm 
		physint
		FOTP_Free 
		FOTP_PFree 	
		Llpop
		LAtrocity
		Increase_stateviolence 
		Increase_stateaccom 
		Decrease_stateviolence 
		Decrease_stateaccom 
		 if anocracy==1, fe vce(robust);
	
*Run lincom commands for the implicit interactions:
lincom threaton  + HumanRightsSanction	
	local cc1 = round(r(estimate), .001)
	local se1 = round(r(se), .001)
	
lincom threaton  + NarrowSanction_bin
	local cc2 = round(r(estimate), .001)
	local se2 = round(r(se), .001)

lincom threaton  + multisender_bin
	local cc3 = round(r(estimate), .001)
	local se3 = round(r(se), .001)

lincom sanctionon  + HumanRightsSanction	
	local cc4 = round(r(estimate), .001)
	local se4 = round(r(se), .001)
	
lincom sanctionon  + NarrowSanction_bin
	local cc5 = round(r(estimate), .001)
	local se5 = round(r(se), .001)

lincom sanctionon  + multisender_bin
	local cc6 = round(r(estimate), .001)
	local se6 = round(r(se), .001)
	
#delimit ;
outreg2 using "Tables\TableA15.txt", text  append
		stats(coef se) aster(coef) sym(***,**,*) cti(Anocracy)
		e(N N_g ll chi2)
		addtext("Other Threats + HR, `cc1'(`se1')" 
			"Other Threats + Narrow, `cc2'(`se2')"
			"Other Threats + Mult, `cc3'(`se3')"
			"Other Imposed + HR, `cc4'(`se4')"
			"Other Imposed + Narrow, `cc5'(`se5')"
			"Other Imposed + Multi, `cc6'(`se6')");
#delimit cr		
		 
*FE Poisson:  autocracies
#delimit ;
xtpois MonthlyEventsThatCount threat_thisobs  
		imposition_thisobs  
		HumanRightsSanction 
		NarrowSanction_bin 
		multisender_bin 
		threaton  
		sanctionon 
		Loverallglobalizationindex
		politynorm 
		physint 
		FOTP_PFree 	
		Llpop
		LAtrocity
		Increase_stateviolence 
		Increase_stateaccom 
		Decrease_stateviolence 
		Decrease_stateaccom 
		 if autocracy==1, fe	vce(robust);
#delimit cr

*Run lincom commands for the implicit interactions:
lincom threaton  + HumanRightsSanction	
	local cc1 = round(r(estimate), .001)
	local se1 = round(r(se), .001)
	
lincom threaton  + NarrowSanction_bin
	local cc2 = round(r(estimate), .001)
	local se2 = round(r(se), .001)

lincom threaton  + multisender_bin
	local cc3 = round(r(estimate), .001)
	local se3 = round(r(se), .001)

lincom sanctionon  + HumanRightsSanction	
	local cc4 = round(r(estimate), .001)
	local se4 = round(r(se), .001)
	
lincom sanctionon  + NarrowSanction_bin
	local cc5 = round(r(estimate), .001)
	local se5 = round(r(se), .001)

lincom sanctionon  + multisender_bin
	local cc6 = round(r(estimate), .001)
	local se6 = round(r(se), .001)
	
#delimit ;
outreg2 using "Tables\TableA15.txt", text  append
		stats(coef se) aster(coef) sym(***,**,*) cti(Autocracy)
		e(N N_g ll chi2)
		addtext("Other Threats + HR, `cc1'(`se1')" 
			"Other Threats + Narrow, `cc2'(`se2')"
			"Other Threats + Mult, `cc3'(`se3')"
			"Other Imposed + HR, `cc4'(`se4')"
			"Other Imposed + Narrow, `cc5'(`se5')"
			"Other Imposed + Multi, `cc6'(`se6')");
#delimit cr		


********************************************
*AUTOCORRELATION ANALYSIS
********************************************



#delimit;
xtsum MonthlyEventsThatCount 
		threat_thisobs 
		imposition_thisobs 
		HumanRightsSanction 
		NarrowSanction_bin 
		multisender_bin 
		threaton 
		sanctionon
		Loverallglobalizationindex
		LAtrocity
		politynorm 
		politynorm_sq
		physint
		Increase_stateviolence 
		Increase_stateaccom 
		Decrease_stateviolence 
		Decrease_stateaccom 
		FOTP_Free 
		FOTP_PFree 
		L1MonthlyEventsThatCount;
#delimit cr

	*interesting:  for almost everything that we care about, the major source of 
	*variation is within rather than between cases. So, we are actually v. good
	*candidates for a fixed effects estimator.

	
**************************************
*Autocorrelation
**************************************
	
*Calculate how closely correlated observations of the DV are across 
*time periods (i.e. serial autocorrelation)

* Serial correlation in monthly count of protests, first w/n each year:
sort targetstate yearmonth
forvalues j = 1/11 {
     quietly corr MonthlyEventsThatCount L`j'.MonthlyEventsThatCount
     display "Autocorrelation at lag `j' = " %6.3f r(rho) 
     }
*Now, let's see if there's any years that matter more:
forvalues year = 1990(1)2005 {
forvalues j = 1/11 {
     quietly corr MonthlyEventsThatCount L`j'.MonthlyEventsThatCount if year==`year'
     display "Autocorrelation at lag `j' in `year' = " %6.3f r(rho) 
     }	 
	 }
*There's some years (e.g. 2001 and 2004) where autocorrelation is 
*much more prevalent than in others (e.g. 1992).


*Make a scatter plot of the autocorrelation between months over the years to 
*quickly illustrate the patterns:

*To do that we need placeholder variables for each lag:
forvalues lag = 1/11	{
	gen RHO_`lag' =.
		label var RHO_`lag' "Correlation between Y_it and Y_it-`lag'"
						}
						
*and an axis to hold the years:
sort targetstate yearmonth
gen YEARAXIS = 1990 in 1
	replace YEARAXIS = YEARAXIS[_n-1] + 1 if _n>1&_n<=16
	tab YEARAXIS
		label var YEARAXIS "Variable holding year values for graphing RHO_1-Rho_11"
		
forvalues year = 1990(1)2005 {
forvalues j = 1/11 {
     quietly corr MonthlyEventsThatCount L`j'.MonthlyEventsThatCount if year==`year'
		replace RHO_`j' = r(rho) if YEARAXIS==`year'
     }	 
	 }		

	
*Ok, now make the graph:
#delimit ;
twoway 	(scatter RHO_1 YEARAXIS, sort  mc(gs0) msym(oh))
		(scatter RHO_2 YEARAXIS, sort  mc(gs1) msym(oh))
		(scatter RHO_3 YEARAXIS, sort  mc(gs2) msym(oh))
		(scatter RHO_4 YEARAXIS, sort  mc(gs3) msym(oh))
		(scatter RHO_5 YEARAXIS, sort  mc(gs4) msym(oh))
		(scatter RHO_6 YEARAXIS, sort  mc(gs5) msym(oh))
		(scatter RHO_7 YEARAXIS, sort  mc(gs6) msym(oh))
		(scatter RHO_8 YEARAXIS, sort  mc(gs7) msym(oh))
		(scatter RHO_9 YEARAXIS, sort  mc(gs8) msym(oh))
		(scatter RHO_10 YEARAXIS, sort  mc(gs9) msym(oh))
		(scatter RHO_11 YEARAXIS, sort  mc(gs10) msym(oh)),
	title("Fig A4. Raw Autocorrelation in Counts of Protests within Years", size(medium))
	xtitle("")
	xlabel(1990(1)2005, labsi(small) angle(forty_five))
	legend(off)
name(figa4, replace)
saving(Graphs/FigA4.gph, replace);
#delimit cr
 	
	
*Let's look and see whether the serial correlation remains after taking the
*covariates into account:
#delimit ;
poisson MonthlyEventsThatCount 
		threat_thisobs 
		imposition_thisobs 
		HumanRightsSanction 
		NarrowSanction_bin 
		multisender_bin 
		threaton 
		sanctionon
		Loverallglobalizationindex
		LAtrocity
		politynorm 
		politynorm_sq
		physint
		Increase_stateviolence 
		Increase_stateaccom 
		Decrease_stateviolence 
		Decrease_stateaccom 
		FOTP_Free 
		FOTP_PFree if FEsample==1;
#delimit cr

predict PoisResid, score
	label var PoisResid "predict, score after poisson of count on the FEsample"
	
forvalues j =1/11	{
		gen RESIDRHO_`j' = .
					}
sort targetstate yearmonth					
forvalues year = 1991(1)2005 {
forvalues j = 1/11 {	
      quietly corr PoisResid L`j'.PoisResid  if year==`year'&e(sample)
		replace RESIDRHO_`j' = r(rho) if YEARAXIS==`year' 
	 }
     }

					
#delimit ;
twoway 	(scatter RESIDRHO_1 YEARAXIS, sort  mc(gs0) msym(oh))
		(scatter RESIDRHO_2 YEARAXIS, sort  mc(gs1) msym(oh))
		(scatter RESIDRHO_3 YEARAXIS, sort  mc(gs2) msym(oh))
		(scatter RESIDRHO_4 YEARAXIS, sort  mc(gs3) msym(oh))
		(scatter RESIDRHO_5 YEARAXIS, sort  mc(gs4) msym(oh))
		(scatter RESIDRHO_6 YEARAXIS, sort  mc(gs5) msym(oh))
		(scatter RESIDRHO_7 YEARAXIS, sort  mc(gs6) msym(oh))
		(scatter RESIDRHO_8 YEARAXIS, sort  mc(gs7) msym(oh))
		(scatter RESIDRHO_9 YEARAXIS, sort  mc(gs8) msym(oh))
		(scatter RESIDRHO_10 YEARAXIS, sort  mc(gs9) msym(oh))
		(scatter RESIDRHO_11 YEARAXIS, sort  mc(gs10) msym(oh)),
	title("Fig A5. Autocorrelation between Residuals after Poisson Regression", size(medium))
	xtitle("")
	xlabel(1991(1)2005, labsi(small) angle(forty_five))
	yline(0, lc(red) lw(vthin))
	legend(off)
name(figa5, replace)
saving(Graphs/FigA5.gph, replace);
#delimit cr	


*Ok, now let's add in country fixed effects manually and calculate 
*residuals to assess improvement (Table A16):
set more off
#delimit ;
poisson MonthlyEventsThatCount 
		threat_thisobs 
		imposition_thisobs 
		HumanRightsSanction 
		NarrowSanction_bin 
		multisender_bin 
		threaton 
		sanctionon
		Loverallglobalizationindex
		FOTP_Free 
		FOTP_PFree
		LAtrocity
		politynorm 
		politynorm_sq
		physint
		Llpop
		Increase_stateviolence 
		Increase_stateaccom 
		Decrease_stateviolence 
		Decrease_stateaccom 
		 i.targetstate if FEsample==1, vce(cluster targetstate);
#delimit cr		
*Let's save these results for the appendix:

*Run lincom commands for the implicit interactions:
lincom threaton  + HumanRightsSanction	
	local cc1 = round(r(estimate), .001)
	local se1 = round(r(se), .001)
	
lincom threaton  + NarrowSanction_bin
	local cc2 = round(r(estimate), .001)
	local se2 = round(r(se), .001)

lincom threaton  + multisender_bin
	local cc3 = round(r(estimate), .001)
	local se3 = round(r(se), .001)

lincom sanctionon  + HumanRightsSanction	
	local cc4 = round(r(estimate), .001)
	local se4 = round(r(se), .001)
	
lincom sanctionon  + NarrowSanction_bin
	local cc5 = round(r(estimate), .001)
	local se5 = round(r(se), .001)

lincom sanctionon  + multisender_bin
	local cc6 = round(r(estimate), .001)
	local se6 = round(r(se), .001)
	
#delimit ;
outreg2 using "Tables\TableA16.txt", text  replace
		stats(coef se) aster(coef) sym(***,**,*) cti(Country Dummies)
		e(N N_cluster ll chi2)
		addtext("Other Threats + HR, `cc1'(`se1')" 
			"Other Threats + Narrow, `cc2'(`se2')"
			"Other Threats + Mult, `cc3'(`se3')"
			"Other Imposed + HR, `cc4'(`se4')"
			"Other Imposed + Narrow, `cc5'(`se5')"
			"Other Imposed + Multi, `cc6'(`se6')");
#delimit cr		 
	
predict FEPoisresid, score

label var FEPoisresid "predict, score after poisson of count on the FEsample, w/dummies"
	
forvalues j =1/11	{
		gen FERESIDRHO_`j' = .
					}
sort targetstate yearmonth					
forvalues year = 1991(1)2005 {
forvalues j = 1/11 {	
      quietly corr FEPoisresid L`j'.FEPoisresid  if year==`year'&e(sample)
		replace FERESIDRHO_`j' = r(rho) if YEARAXIS==`year' 
	 }
     }

					
#delimit ;
twoway 	(scatter FERESIDRHO_1 YEARAXIS, sort  mc(gs0) msym(oh))
		(scatter FERESIDRHO_2 YEARAXIS, sort  mc(gs1) msym(oh))
		(scatter FERESIDRHO_3 YEARAXIS, sort  mc(gs2) msym(oh))
		(scatter FERESIDRHO_4 YEARAXIS, sort  mc(gs3) msym(oh))
		(scatter FERESIDRHO_5 YEARAXIS, sort  mc(gs4) msym(oh))
		(scatter FERESIDRHO_6 YEARAXIS, sort  mc(gs5) msym(oh))
		(scatter FERESIDRHO_7 YEARAXIS, sort  mc(gs6) msym(oh))
		(scatter FERESIDRHO_8 YEARAXIS, sort  mc(gs7) msym(oh))
		(scatter FERESIDRHO_9 YEARAXIS, sort  mc(gs8) msym(oh))
		(scatter FERESIDRHO_10 YEARAXIS, sort  mc(gs9) msym(oh))
		(scatter FERESIDRHO_11 YEARAXIS, sort  mc(gs10) msym(oh)),
	title("Fig A6. Autocorrelation between Residuals after Poisson Regression" "with Country Dummies", size(medium))
	xtitle("")
	xlabel(1991(1)2005, labsi(small) angle(forty_five))
	yline(0, lc(red) lw(vthin))
	legend(off)
	note("NOTE: Darker markers indicate correlation with lags of shorter duration, with black giving one month.", size(vsmall))
name(figa6, replace)
saving(Graphs/FigA6.gph, replace);
#delimit cr	
	*We've eliminated any worrying trends over time simply
	*by implementing the country fixed-effects 

	*We might consider still implementing a means of controlling for time
	*dynamics. A cubic of year, might make sense given the wiggle in the 
	*correlations in the residuals. Alternatively, we might consider throwing
	*in a dummy for each year that looks unbalanced in terms of positive-negative
	*correlations:  1992, 1996, 2000, 2001, 2004
	
	*Other points of interest from this model:  
	*1) The Wald Chi2 couldn't be estimated which suggests that we are running a 
	*model of dim(beta) that is, too high given the clustered standard errors. 
	*That suggests that we will gain some additional leverage by using the FE 
	*estimator instead of the dummy approach.
	*2) The results look much more like what we got from our ZINB models than the 
	*xtnbreg results, which extra suggests to me that our data doesn't meet the 
	*assumptions of the NB1 FE estimator.
	
*Ok, let's try implementing some time dynamics:
	
*Run Dummy Variable Poisson and assess improvements after
*controlling for country fixed effects (Table A16, model 2):
#delimit ;
poisson MonthlyEventsThatCount 
		threat_thisobs 
		imposition_thisobs 
		HumanRightsSanction 
		NarrowSanction_bin 
		multisender_bin 
		threaton 
		sanctionon
		Loverallglobalizationindex
		LAtrocity
		politynorm 
		politynorm_sq
		physint
		Llpop
		Increase_stateviolence 
		Increase_stateaccom 
		Decrease_stateviolence 
		Decrease_stateaccom 
		FOTP_Free 
		FOTP_PFree 		
		 _1992 
		 _1996 
		 _2000 
		 _2001 
		 _2004 
		i.targetstate if FEsample==1, vce(cluster targetstate);
#delimit cr			

*Run lincom commands for the implicit interactions:
lincom threaton  + HumanRightsSanction	
	local cc1 = round(r(estimate), .001)
	local se1 = round(r(se), .001)
	
lincom threaton  + NarrowSanction_bin
	local cc2 = round(r(estimate), .001)
	local se2 = round(r(se), .001)

lincom threaton  + multisender_bin
	local cc3 = round(r(estimate), .001)
	local se3 = round(r(se), .001)

lincom sanctionon  + HumanRightsSanction	
	local cc4 = round(r(estimate), .001)
	local se4 = round(r(se), .001)
	
lincom sanctionon  + NarrowSanction_bin
	local cc5 = round(r(estimate), .001)
	local se5 = round(r(se), .001)

lincom sanctionon  + multisender_bin
	local cc6 = round(r(estimate), .001)
	local se6 = round(r(se), .001)
	
#delimit ;
outreg2 using "Tables\TableA16.txt", text  append
		stats(coef se) aster(coef) sym(***,**,*) cti(w/select dummies)
		e(N N_cluster ll chi2)
		addtext("Other Threats + HR, `cc1'(`se1')" 
			"Other Threats + Narrow, `cc2'(`se2')"
			"Other Threats + Mult, `cc3'(`se3')"
			"Other Imposed + HR, `cc4'(`se4')"
			"Other Imposed + Narrow, `cc5'(`se5')"
			"Other Imposed + Multi, `cc6'(`se6')");
#delimit cr		 
predict FEtdPoisresid, score

label var FEtdPoisresid "predict, score after poisson FEsample, w/dummies and time dummies"
	
forvalues j =1/11	{
		gen FEtdRESIDRHO_`j' = .
					}
sort targetstate yearmonth					
forvalues year = 1991(1)2005 {
forvalues j = 1/11 {	
      quietly corr FEtdPoisresid L`j'.FEtdPoisresid  if year==`year'&e(sample)
		replace FEtdRESIDRHO_`j' = r(rho) if YEARAXIS==`year' 
	 }
     }

					
#delimit ;
twoway 	(scatter FEtdRESIDRHO_1 YEARAXIS, sort  mc(gs0) msym(oh))
		(scatter FEtdRESIDRHO_2 YEARAXIS, sort  mc(gs1) msym(oh))
		(scatter FEtdRESIDRHO_3 YEARAXIS, sort  mc(gs2) msym(oh))
		(scatter FEtdRESIDRHO_4 YEARAXIS, sort  mc(gs3) msym(oh))
		(scatter FEtdRESIDRHO_5 YEARAXIS, sort  mc(gs4) msym(oh))
		(scatter FEtdRESIDRHO_6 YEARAXIS, sort  mc(gs5) msym(oh))
		(scatter FEtdRESIDRHO_7 YEARAXIS, sort  mc(gs6) msym(oh))
		(scatter FEtdRESIDRHO_8 YEARAXIS, sort  mc(gs7) msym(oh))
		(scatter FEtdRESIDRHO_9 YEARAXIS, sort  mc(gs8) msym(oh))
		(scatter FEtdRESIDRHO_10 YEARAXIS, sort  mc(gs9) msym(oh))
		(scatter FEtdRESIDRHO_11 YEARAXIS, sort  mc(gs10) msym(oh)),
	title("Fig A7. Autocorrelation between Residuals after Poisson Regression" "with Country Dummies & Select Time Dummies", size(medium))
	xtitle("")
	xlabel(1991(1)2005, labsi(small) angle(forty_five))
	yline(0, lc(red) lw(vthin))
	legend(off)
	note("NOTE: Darker markers indicate correlation with lags of shorter duration, with black giving one month.", size(vsmall))
name(figa7, replace)
saving(Graphs/FigA7.gph, replace);
#delimit cr	
	
	
*Run model w/lagged DV as well as country fixed effects:
#delimit ;
poisson MonthlyEventsThatCount 
		threat_thisobs 
		imposition_thisobs 
		HumanRightsSanction 
		NarrowSanction_bin 
		multisender_bin 
		threaton 
		sanctionon
		Loverallglobalizationindex
		LAtrocity
		politynorm 
		politynorm_sq
		physint
		Increase_stateviolence 
		Increase_stateaccom 
		Decrease_stateviolence 
		Decrease_stateaccom 
		FOTP_Free 
		FOTP_PFree 		
		L1MonthlyEventsThatCount
		i.targetstate if FEsample==1, vce(cluster targetstate);
#delimit cr		
		


predict FEtdLPoisresid, score

label var FEtdLPoisresid "predict, score after poisson FEsample, w/dummies,time dummies, L1DV"
	
forvalues j =1/11	{
		gen FEtdLRESIDRHO_`j' = .
					}
sort targetstate yearmonth					
forvalues year = 1991(1)2005 {
forvalues j = 1/11 {	
      quietly corr FEtdLPoisresid L`j'.FEtdLPoisresid  if year==`year'&e(sample)
		replace FEtdLRESIDRHO_`j' = r(rho) if YEARAXIS==`year' 
	 }
     }

					
#delimit ;
twoway 	(scatter FEtdLRESIDRHO_1 YEARAXIS, sort  mc(gs0) msym(oh))
		(scatter FEtdLRESIDRHO_2 YEARAXIS, sort  mc(gs1) msym(oh))
		(scatter FEtdLRESIDRHO_3 YEARAXIS, sort  mc(gs2) msym(oh))
		(scatter FEtdLRESIDRHO_4 YEARAXIS, sort  mc(gs3) msym(oh))
		(scatter FEtdLRESIDRHO_5 YEARAXIS, sort  mc(gs4) msym(oh))
		(scatter FEtdLRESIDRHO_6 YEARAXIS, sort  mc(gs5) msym(oh))
		(scatter FEtdLRESIDRHO_7 YEARAXIS, sort  mc(gs6) msym(oh))
		(scatter FEtdLRESIDRHO_8 YEARAXIS, sort  mc(gs7) msym(oh))
		(scatter FEtdLRESIDRHO_9 YEARAXIS, sort  mc(gs8) msym(oh))
		(scatter FEtdLRESIDRHO_10 YEARAXIS, sort  mc(gs9) msym(oh))
		(scatter FEtdLRESIDRHO_11 YEARAXIS, sort  mc(gs10) msym(oh)),
	title("Autocorrelation between Residuals after Poisson Regression" "with Country Dummies, Select Time Dummies & Lagged DV", size(medium))
	xtitle("")
	xlabel(1991(1)2005, labsi(small) angle(forty_five))
	yline(0, lc(red) lw(vthin))
	legend(off)
	note("NOTE: Darker markers indicate correlation with lags of shorter duration, with black giving one month.", size(vsmall))
name(FEtdLresidrho, replace);
#delimit cr	

*let's compare the residual correlations for the model w/lagged DV and w/o:
forvalues j = 1/11	{
gen RhoDiff2abval_`j' = abs(FEtdLRESIDRHO_`j') - abs(FEtdRESIDRHO_`j')
					}
					
#delimit ;
twoway 	(scatter RhoDiff2abval_1 YEARAXIS, sort  mc(gs0) msym(oh))
		(scatter RhoDiff2abval_2 YEARAXIS, sort  mc(gs1) msym(oh))
		(scatter RhoDiff2abval_3 YEARAXIS, sort  mc(gs2) msym(oh))
		(scatter RhoDiff2abval_4 YEARAXIS, sort  mc(gs3) msym(oh))
		(scatter RhoDiff2abval_5 YEARAXIS, sort  mc(gs4) msym(oh))
		(scatter RhoDiff2abval_6 YEARAXIS, sort  mc(gs5) msym(oh))
		(scatter RhoDiff2abval_7 YEARAXIS, sort  mc(gs6) msym(oh))
		(scatter RhoDiff2abval_8 YEARAXIS, sort  mc(gs7) msym(oh))
		(scatter RhoDiff2abval_9 YEARAXIS, sort  mc(gs8) msym(oh))
		(scatter RhoDiff2abval_10 YEARAXIS, sort  mc(gs9) msym(oh))
		(scatter RhoDiff2abval_11 YEARAXIS, sort  mc(gs10) msym(oh)),
	title("Fig A8. Difference in Residuals' Correlations" "|w/Lagged DV| - |w/o Lagged DV|", size(medium))
	xtitle("")
	xlabel(1991(1)2005, labsi(small) angle(forty_five))
	yline(0, lc(red) lw(vthin))
	legend(off)
	note("NOTE: Darker markers indicate correlation with lags of shorter duration, with black giving one month.", size(vsmall))
name(figa8, replace)
saving(Graphs/FigA8.gph, replace);
#delimit cr


*********************************************
*Alternative Modeling Strategy
*********************************************

set more off
#delimit ;
biprobit 	(Increase_simple = 	threat_thisobs 
								imposition_thisobs 
								HumanRightsSanction 
								NarrowSanction_bin 
								multisender_bin
								threaton
								sanctionon) 
			(Decrease_simple =	threat_thisobs 
								imposition_thisobs 
								HumanRightsSanction 
								NarrowSanction_bin 
								multisender_bin
								threaton 
								sanctionon),
	cluster(targetstate);
#delimit cr	
*Run lincom commands for the implicit interactions:
lincom threaton + HumanRightsSanction	
	local cc1 = round(r(estimate), .001)
	local se1 = round(r(se), .001)
	
lincom threaton + NarrowSanction_bin
	local cc2 = round(r(estimate), .001)
	local se2 = round(r(se), .001)

lincom threaton + multisender_bin
	local cc3 = round(r(estimate), .001)
	local se3 = round(r(se), .001)

lincom sanctionon + HumanRightsSanction	
	local cc4 = round(r(estimate), .001)
	local se4 = round(r(se), .001)
	
lincom sanctionon + NarrowSanction_bin
	local cc5 = round(r(estimate), .001)
	local se5 = round(r(se), .001)

lincom sanctionon + multisender_bin
	local cc6 = round(r(estimate), .001)
	local se6 = round(r(se), .001)
	
*Repeat for second equation:	
lincom [Decrease_simple]threaton + [Decrease_simple]HumanRightsSanction	
	local cc7 = round(r(estimate), .001)
	local se7 = round(r(se), .001)
	
lincom [Decrease_simple]threaton + [Decrease_simple]NarrowSanction_bin
	local cc8 = round(r(estimate), .001)
	local se8 = round(r(se), .001)

lincom [Decrease_simple]threaton + [Decrease_simple]multisender_bin
	local cc9 = round(r(estimate), .001)
	local se9 = round(r(se), .001)

lincom [Decrease_simple]sanctionon + [Decrease_simple]HumanRightsSanction	
	local cc10 = round(r(estimate), .001)
	local se10 = round(r(se), .001)
	
lincom [Decrease_simple]sanctionon + [Decrease_simple]NarrowSanction_bin
	local cc11 = round(r(estimate), .001)
	local se11 = round(r(se), .001)

lincom [Decrease_simple]sanctionon + [Decrease_simple]multisender_bin
	local cc12 = round(r(estimate), .001)
	local se12 = round(r(se), .001)
	
#delimit ;
outreg2 using "Tables\TableA17.txt", text replace
		stats(coef se) aster(coef) sym(***,**,*) 
		e(chi2_c rho chi2 df_m N N_clust ll)
		addtext("[Increase] Other Threats + HR, `cc1'(`se1')" 
			"[Increase] Other Threats + Narrow, `cc2'(`se2')"
			"[Increase] Other Threats + Mult, `cc3'(`se3')"
			"[Increase] Other Imposed + HR, `cc4'(`se4')"
			"[Increase] Other Imposed + Narrow, `cc5'(`se5')"
			"[Increase] Other Imposed + Multi, `cc6'(`se6')"
			"[Decrease] Other Threats + HR, `cc7'(`se7')" 
			"[Decrease] Other Threats + Narrow, `cc8'(`se8')"
			"[Decrease] Other Threats + Mult, `cc9'(`se9')"
			"[Decrease] Other Imposed + HR, `cc10'(`se10')"
			"[Decrease] Other Imposed + Narrow, `cc11'(`se11')"
			"[Decrease] Other Imposed + Multi, `cc12'(`se12')");
#delimit cr	

*Run with controls:
set more off
#delimit ;
biprobit 	(Increase_simple = 	threat_thisobs 
								imposition_thisobs 
								HumanRightsSanction 
								NarrowSanction_bin 
								multisender_bin
								threaton
								sanctionon
								Llrealgdp
								FOTP_Free 
								FOTP_NFree 
								Loverallglobalizationindex
								politynorm 
								politynorm_sq
								physint
								LAtrocity
								Increase_stateviolence 
								Increase_stateaccom
								Decrease_stateviolence 
								Decrease_stateaccom) 
			(Decrease_simple =	threat_thisobs 
								imposition_thisobs 
								HumanRightsSanction 
								NarrowSanction_bin 
								multisender_bin
								threaton 
								sanctionon
								Llrealgdp
								FOTP_Free 
								FOTP_NFree
								Loverallglobalizationindex
								politynorm 
								politynorm_sq
								physint
								LAtrocity
								Increase_stateviolence 
								Increase_stateaccom
								Decrease_stateviolence 
								Decrease_stateaccom),
	cluster(targetstate);
#delimit ;


*Run lincom commands for the implicit interactions:
lincom threaton + HumanRightsSanction	
	local cc1 = round(r(estimate), .001)
	local se1 = round(r(se), .001)
	
lincom threaton + NarrowSanction_bin
	local cc2 = round(r(estimate), .001)
	local se2 = round(r(se), .001)

lincom threaton + multisender_bin
	local cc3 = round(r(estimate), .001)
	local se3 = round(r(se), .001)

lincom sanctionon + HumanRightsSanction	
	local cc4 = round(r(estimate), .001)
	local se4 = round(r(se), .001)
	
lincom sanctionon + NarrowSanction_bin
	local cc5 = round(r(estimate), .001)
	local se5 = round(r(se), .001)

lincom sanctionon + multisender_bin
	local cc6 = round(r(estimate), .001)
	local se6 = round(r(se), .001)
	
*Repeat for second equation:	
lincom [Decrease_simple]threaton + [Decrease_simple]HumanRightsSanction	
	local cc7 = round(r(estimate), .001)
	local se7 = round(r(se), .001)
	
lincom [Decrease_simple]threaton + [Decrease_simple]NarrowSanction_bin
	local cc8 = round(r(estimate), .001)
	local se8 = round(r(se), .001)

lincom [Decrease_simple]threaton + [Decrease_simple]multisender_bin
	local cc9 = round(r(estimate), .001)
	local se9 = round(r(se), .001)

lincom [Decrease_simple]sanctionon + [Decrease_simple]HumanRightsSanction	
	local cc10 = round(r(estimate), .001)
	local se10 = round(r(se), .001)
	
lincom [Decrease_simple]sanctionon + [Decrease_simple]NarrowSanction_bin
	local cc11 = round(r(estimate), .001)
	local se11 = round(r(se), .001)

lincom [Decrease_simple]sanctionon + [Decrease_simple]multisender_bin
	local cc12 = round(r(estimate), .001)
	local se12 = round(r(se), .001)	
#delimit ;
outreg2 using "Tables\TableA17.txt", text label append
		stats(coef se) aster(coef) sym(***,**,*) cti(With Controls)
		e(chi2_c rho chi2 df_m N N_clust ll)
		addtext("[Increase] Other Threats + HR, `cc1'(`se1')" 
			"[Increase] Other Threats + Narrow, `cc2'(`se2')"
			"[Increase] Other Threats + Mult, `cc3'(`se3')"
			"[Increase] Other Imposed + HR, `cc4'(`se4')"
			"[Increase] Other Imposed + Narrow, `cc5'(`se5')"
			"[Increase] Other Imposed + Multi, `cc6'(`se6')"
			"[Decrease] Other Threats + HR, `cc7'(`se7')" 
			"[Decrease] Other Threats + Narrow, `cc8'(`se8')"
			"[Decrease] Other Threats + Mult, `cc9'(`se9')"
			"[Decrease] Other Imposed + HR, `cc10'(`se10')"
			"[Decrease] Other Imposed + Narrow, `cc11'(`se11')"
			"[Decrease] Other Imposed + Multi, `cc12'(`se12')");
#delimit cr

*Preserve matrices for simulation procedure:
	mat def b = e(b) 
	mat def V = e(V)

*Make dataset of IVs at mean/modal values:
	#delimit ;
	collapse (mean) Llrealgdp
					FOTP_Free 
					FOTP_NFree 
					Loverallglobalizationindex
					politynorm 
					physint
					LAtrocity
					Increase_stateviolence 
					Increase_stateaccom
					Decrease_stateviolence 
					Decrease_stateaccom;
					
	*round to nearest integer value for most of these:				
	#delimit ;
	foreach var in FOTP_Free 
					FOTP_NFree
					politynorm 
					physint
					LAtrocity
					Increase_stateviolence 
					Increase_stateaccom
					Decrease_stateviolence 
					Decrease_stateaccom	{;
	#delimit cr		
		replace `var' = round(`var', 1)	
										}
	*get square of mean of politynorm
	gen politynorm_sq = politynorm^2
expand 1000
save Data/GL&vS_Pdiffs_IVs.dta, replace

sum

*************************************************************************
*Interpretation
*************************************************************************

*Write a progarm to calculate probabilities and differences therein from
*the bivariate probit. This program follows the same basic intuition as 
*the heavily commented one in the first replication file, just converted
*to work with the bivariate probit's likelihood function. See the earlier
*file for questions regarding the mechanics of the program.

program define pdiffs
	
	*open up the dataset of IVs at means/modes:
	use Data/GL&vS_Pdiffs_IVs.dta, clear
	
	*draw set of 1000 betas:
	drawnorm double b1-b41, means(b) cov(V)
	
		*transform ath/rho to be bounded by -1 +1 
		gen rho = (exp(2*tanh(b41))-1)/(exp(2*tanh(b41))+1)
		
	*Generate predicted probabilities for new threats/impositions given no ongoing:
		foreach new in 0 1	{
		
			#delimit ;
			gen XBup_NT`new' = 	b1*`new'+
								b8*Llrealgdp+
								b9*FOTP_Free +
								b10*FOTP_NFree +
								b11*Loverallglobalizationindex+
								b12*politynorm +
								b13*politynorm_sq+
								b14*physint+
								b15*LAtrocity+
								b16*Increase_stateviolence +
								b17*Increase_stateaccom+
								b18*Decrease_stateviolence +
								b19*Decrease_stateaccom +
								b20;

				
			gen XBdwn_NT`new' =	b21*`new'+ 
								b28*Llrealgdp+
								b29*FOTP_Free +
								b30*FOTP_NFree +
								b31*Loverallglobalizationindex+
								b32*politynorm +
								b33*politynorm_sq+
								b34*physint+
								b35*LAtrocity+
								b36*Increase_stateviolence +
								b37*Increase_stateaccom+
								b38*Decrease_stateviolence +
								b39*Decrease_stateaccom+
								b40;

			
			gen XBup_NI`new' = b2*`new'+
								b8*Llrealgdp+
								b9*FOTP_Free +
								b10*FOTP_NFree +
								b11*Loverallglobalizationindex+
								b12*politynorm +
								b13*politynorm_sq+
								b14*physint+
								b15*LAtrocity+
								b16*Increase_stateviolence +
								b17*Increase_stateaccom+
								b18*Decrease_stateviolence +
								b19*Decrease_stateaccom +
								b20;
				
			gen XBdwn_NI`new'=	b22*`new'+
								b28*Llrealgdp+
								b29*FOTP_Free +
								b30*FOTP_NFree +
								b31*Loverallglobalizationindex+
								b32*politynorm +
								b33*politynorm_sq+
								b34*physint+
								b35*LAtrocity+
								b36*Increase_stateviolence +
								b37*Increase_stateaccom+
								b38*Decrease_stateviolence +
								b39*Decrease_stateaccom+
								b40;
			#delimit cr
			
			gen Pup_NT`new' = binormal(XBup_NT`new', -XBdwn_NT`new', -rho)
			
			gen Pup_NI`new' = binormal(XBup_NI`new', -XBdwn_NI`new', -rho)
			
			gen Pdwn_NT`new' = binormal(-XBup_NT`new', XBdwn_NT`new', -rho)
			
			gen Pdwn_NI`new' = binormal(-XBup_NI`new', XBdwn_NI`new', -rho)
							}
						
	*Generate predicted probabiltiies for new threats/impositions given ongoing
	*threats/impositions and of ongoing when new are off:
		foreach new in 0 1	{
		foreach OT in 0 1	{
		foreach OI in 0 1	{
		foreach HR in 0 1	{
		foreach narr in 0 1	{
		foreach mult in 0 1	{
		
			#delimit ;
			gen XBup_NT`new'_`OT'`OI'_H`HR'_N`narr'_M`mult' = 	b1*`new'+
																b3*`HR'+
																b4*`narr'+
																b5*`mult'+
																b6*`OT'+
																b7*`OI'+
																b8*Llrealgdp+
																b9*FOTP_Free +
																b10*FOTP_NFree +
																b11*Loverallglobalizationindex+
																b12*politynorm +
																b13*politynorm_sq+
																b14*physint+
																b15*LAtrocity+
																b16*Increase_stateviolence +
																b17*Increase_stateaccom+
																b18*Decrease_stateviolence +
																b19*Decrease_stateaccom +
																b20;
																
			gen XBup_NI`new'_`OT'`OI'_H`HR'_N`narr'_M`mult' = 	b2*`new'+
																b3*`HR'+
																b4*`narr'+
																b5*`mult'+
																b6*`OT'+
																b7*`OI'+
																b8*Llrealgdp+
																b9*FOTP_Free +
																b10*FOTP_NFree +
																b11*Loverallglobalizationindex+
																b12*politynorm +
																b13*politynorm_sq+
																b14*physint+
																b15*LAtrocity+
																b16*Increase_stateviolence +
																b17*Increase_stateaccom+
																b18*Decrease_stateviolence +
																b19*Decrease_stateaccom +
																b20;	
																
			gen XBdwn_NT`new'_`OT'`OI'_H`HR'_N`narr'_M`mult' = 	b21*`new'+
																b23*`HR'+
																b24*`narr'+
																b25*`mult'+
																b26*`OT'+
																b27*`OI'+
																b28*Llrealgdp+
																b29*FOTP_Free +
																b30*FOTP_NFree +
																b31*Loverallglobalizationindex+
																b32*politynorm +
																b33*politynorm_sq+
																b34*physint+
																b35*LAtrocity+
																b36*Increase_stateviolence +
																b37*Increase_stateaccom+
																b38*Decrease_stateviolence +
																b39*Decrease_stateaccom+
																b40;

																	
			gen XBdwn_NI`new'_`OT'`OI'_H`HR'_N`narr'_M`mult' = 	b22*`new'+
																b23*`HR'+
																b24*`narr'+
																b25*`mult'+
																b26*`OT'+
																b27*`OI'+
																b28*Llrealgdp+
																b29*FOTP_Free +
																b30*FOTP_NFree +
																b31*Loverallglobalizationindex+
																b32*politynorm +
																b33*politynorm_sq+
																b34*physint+
																b35*LAtrocity+
																b36*Increase_stateviolence +
																b37*Increase_stateaccom+
																b38*Decrease_stateviolence +
																b39*Decrease_stateaccom+
																b40;
																
			gen Pup_NT`new'_`OT'`OI'_H`HR'_N`narr'_M`mult' = binormal(XBup_NT`new'_`OT'`OI'_H`HR'_N`narr'_M`mult',
																		-XBdwn_NT`new'_`OT'`OI'_H`HR'_N`narr'_M`mult', -rho);
																		
			gen Pup_NI`new'_`OT'`OI'_H`HR'_N`narr'_M`mult' = binormal(XBup_NI`new'_`OT'`OI'_H`HR'_N`narr'_M`mult',
																		-XBdwn_NI`new'_`OT'`OI'_H`HR'_N`narr'_M`mult', -rho);
																		
			gen Pdwn_NT`new'_`OT'`OI'_H`HR'_N`narr'_M`mult' = binormal(-XBup_NT`new'_`OT'`OI'_H`HR'_N`narr'_M`mult',
																		XBdwn_NT`new'_`OT'`OI'_H`HR'_N`narr'_M`mult', -rho);
																		
			gen Pdwn_NI`new'_`OT'`OI'_H`HR'_N`narr'_M`mult' = binormal(-XBup_NI`new'_`OT'`OI'_H`HR'_N`narr'_M`mult',
																		XBdwn_NI`new'_`OT'`OI'_H`HR'_N`narr'_M`mult', -rho);															
			#delimit cr														
			label var Pup_NT`new'_`OT'`OI'_H`HR'_N`narr'_M`mult' "P(Up|NT=`new',OT=`OT',OI=`OI',HR=`HR',narr=`narr',multi=`multi')"
			label var Pup_NI`new'_`OT'`OI'_H`HR'_N`narr'_M`mult' "P(Up|NI=`new',OT=`OT',OI=`OI',HR=`HR',narr=`narr',multi=`multi')"
			label var Pdwn_NT`new'_`OT'`OI'_H`HR'_N`narr'_M`mult' "P(Dwn|NT=`new',OT=`OT',OI=`OI',HR=`HR',narr=`narr',multi=`multi')"
			label var Pdwn_NI`new'_`OT'`OI'_H`HR'_N`narr'_M`mult' "P(Dwn|NI=`new',OT=`OT',OI=`OI',HR=`HR',narr=`narr',multi=`multi')"

							}
							}
							}
							}
							}
							}
							
							
	
	*Generate differences in probability:
	foreach y in up dwn	{
	
	*1) new threat/imposition on vs. off

		gen D`y'_NT10 = P`y'_NT1 - P`y'_NT0
		gen D`y'_NI10 = P`y'_NI1 - P`y'_NT0
							
	*2) ongoing threats/impositions vs no episodes by type:
	
		gen D`y'_OT10_HR = P`y'_NT0_10_H1_N0_M0 - P`y'_NT0_00_H0_N0_M0
		gen D`y'_OT10_N = P`y'_NT0_10_H0_N1_M0 - P`y'_NT0_00_H0_N0_M0
		gen D`y'_OT10_M = P`y'_NT0_10_H0_N0_M1 - P`y'_NT0_00_H0_N0_M0
		
		
		gen D`y'_OI10_HR = P`y'_NT0_01_H1_N0_M0 - P`y'_NT0_00_H0_N0_M0
		gen D`y'_OI10_N = P`y'_NT0_01_H0_N1_M0 - P`y'_NT0_00_H0_N0_M0
		gen D`y'_OI10_M = P`y'_NT0_01_H0_N0_M1 - P`y'_NT0_00_H0_N0_M0
		
	*3) ongoing threats/impositions  of type vs. generic type:
		gen D`y'_OT_HR10 = P`y'_NT0_10_H1_N0_M0 - P`y'_NT0_10_H0_N0_M0
		gen D`y'_OT_N10 = P`y'_NT0_10_H0_N1_M0 - P`y'_NT0_10_H0_N0_M0
		gen D`y'_OT_M10 = P`y'_NT0_10_H0_N0_M1 - P`y'_NT0_10_H0_N0_M0
		
		
		gen D`y'_OI_HR10 = P`y'_NT0_01_H1_N0_M0 - P`y'_NT0_01_H0_N0_M0
		gen D`y'_OI_N10 = P`y'_NT0_01_H0_N1_M0 - P`y'_NT0_01_H0_N0_M0
		gen D`y'_OI_M10 = P`y'_NT0_01_H0_N0_M1 - P`y'_NT0_01_H0_N0_M0
		
	*4) new threats given ongoing threats/impositions of type vs no ongoing
	
		gen D`y'_NT1_OT10_HR = P`y'_NT1_10_H1_N0_M0 - P`y'_NT1_00_H0_N0_M0
		gen D`y'_NT1_OT10_N = P`y'_NT1_10_H0_N1_M0 - P`y'_NT1_00_H0_N0_M0
		gen D`y'_NT1_OT10_M = P`y'_NT1_10_H0_N0_M1 - P`y'_NT1_00_H0_N0_M0
		
		
		gen D`y'_NT1_OI10_HR = P`y'_NT1_01_H1_N0_M0 - P`y'_NT1_00_H0_N0_M0
		gen D`y'_NT1_OI10_N = P`y'_NT1_01_H0_N1_M0 - P`y'_NT1_00_H0_N0_M0
		gen D`y'_NT1_OI10_M = P`y'_NT1_01_H0_N0_M1 - P`y'_NT1_00_H0_N0_M0

	*5) new threats given ongoing threats/impositions of type vs generic ongoing type:
		gen D`y'_NT1_OT_HR10 = P`y'_NT1_10_H1_N0_M0 - P`y'_NT1_10_H0_N0_M0
		gen D`y'_NT1_OT_N10 = P`y'_NT1_10_H0_N1_M0 - P`y'_NT1_10_H0_N0_M0
		gen D`y'_NT1_OT_M10 = P`y'_NT1_10_H0_N0_M1 - P`y'_NT1_10_H0_N0_M0
		
		
		gen D`y'_NT1_OI_HR10 = P`y'_NT1_01_H1_N0_M0 - P`y'_NT1_01_H0_N0_M0
		gen D`y'_NT1_OI_N10 = P`y'_NT1_01_H0_N1_M0 - P`y'_NT1_01_H0_N0_M0
		gen D`y'_NT1_OI_M10 = P`y'_NT1_01_H0_N0_M1 - P`y'_NT1_01_H0_N0_M0
								}
								
		keep P* D* 						

		append using Data/GL&vS_pdiffs.dta
		save Data/GL&vS_pdiffs.dta, replace
		clear
end

*Make empty datasets for the results to end up in
clear 	
save Data/GL&vS_pdiffs.dta, replace emptyok

*for the CI we'll make them with an observation, so that they can be
*merged during the statsby loops and avoid having to fill the results 
*in before graphing:
clear
set obs 1	
save Data/GL&vS_pdiffs_CIs.dta, replace emptyok	


set more off
	simulate, reps(1000): pdiffs, m(`m')
					
					
set more off				
*Run statsby loops				
use Data/GL&vS_pdiffs.dta, clear

foreach y in up dwn	{
#delimit ;
foreach var in 	D`y'_NT10
				D`y'_NI10
				D`y'_OT10_HR
				D`y'_OT10_N
				D`y'_OT10_M
				D`y'_OI10_HR
				D`y'_OI10_N
				D`y'_OI10_M
				D`y'_OT_HR10
				D`y'_OT_N10
				D`y'_OT_M10
				D`y'_OI_HR10
				D`y'_OI_N10
				D`y'_OI_M10
				D`y'_NT1_OT10_HR
				D`y'_NT1_OT10_N
				D`y'_NT1_OT10_M
				D`y'_NT1_OT10_HR
				D`y'_NT1_OT10_N
				D`y'_NT1_OT10_M
				D`y'_NT1_OI10_HR
				D`y'_NT1_OI10_N
				D`y'_NT1_OI10_M
				D`y'_NT1_OT_HR10
				D`y'_NT1_OT_N10
				D`y'_NT1_OT_M10
				D`y'_NT1_OI_HR10
				D`y'_NT1_OI_N10
				D`y'_NT1_OI_M10	
				P`y'_NT1  
				P`y'_NT0
				P`y'_NI1  
				P`y'_NI0
				P`y'_NT0_00_H0_N0_M0
				P`y'_NT0_10_H0_N0_M0
				P`y'_NT0_01_H0_N0_M0
				P`y'_NT1_00_H0_N0_M0
				P`y'_NT1_01_H0_N0_M0
				P`y'_NT1_10_H0_N0_M0
				P`y'_NT0_10_H1_N0_M0
				P`y'_NT0_10_H0_N1_M0
				P`y'_NT0_10_H0_N0_M1
				P`y'_NT0_01_H1_N0_M0
				P`y'_NT0_01_H0_N1_M0
				P`y'_NT0_01_H0_N0_M1
				P`y'_NT1_10_H1_N0_M0
				P`y'_NT1_10_H0_N1_M0
				P`y'_NT1_10_H0_N0_M1
				P`y'_NT1_01_H1_N0_M0
				P`y'_NT1_01_H0_N1_M0
				P`y'_NT1_01_H0_N0_M1{;					
#delimit cr

	use Data/GL&vS_pdiffs.dta, clear
	
	statsby `var'_lo = r(r1) `var'_med = r(r2) `var'_hi = r(r3), clear: _pctile `var', p(2.5, 50, 97.5)
	
	merge 1:1 _n using Data/GL&vS_pdiffs_CIs.dta, nogen
	save Data/GL&vS_pdiffs_CIs.dta, replace

 
								}
							}
							

*******************							
*Graph results:
*******************

*Make a Yaxis variable to graph against:
expand 20
	gen Yaxis = _n-1 if _n<=20
	*label drop Yfmt
	#delimit ;								
	lab def Yfmt 0 " " 
				1 "Targeted		" 
				2 "Human Rights    " 
				3 "New Threat + Ongoing Imposed" 
				4 " " 
				5 "Targeted		" 
				6 "Human Rights    " 
				7 "New Threat + Ongoing Threat    " 
				8 " "
				9 	"Targeted	  " 
				10 	"Human Rights" 
				11 "Ongoing Imposed" 
				12  " "
				13 "Targeted	     " 
				14 "Human Rights" 
				15 "Ongoing Threat    " 
				16 " " 
				17 "New Imposition" 
				18 "New Threat    "	
				19 " ";
		#delimit cr
	tab Yaxis
	label val Yaxis Yfmt
	tab Yaxis
	
*Now, create a spike plot that compares the effects without a new sanction (graphed as an
*area) to that with the sanction (graphed as rspikes and dots):	
#delimit ;	
twoway 	(rarea Pup_NT0_lo Pup_NT0_hi Yaxis if Yaxis>=7, horiz fc(gs14) lc(gs14))
		(rarea Pup_NT1_hi Pup_NT1_lo  Yaxis if Yaxis<=7, 
			horiz fc(gs14) lc(gs14)
			ylabel(0(1)18 ,valuelabel angle(horiz))) 
			
		(rspike Pup_NT1_hi Pup_NT1_lo Yaxis if Yaxis==18, horiz sort blc(black) blw(thin))
		(scatter Yaxis Pup_NT1_med if Yaxis==18, sort msym(circle_hollow) mc(black))
		
		(rspike Pup_NI1_hi Pup_NI1_lo Yaxis if Yaxis==17, horiz sort blc(black) blw(thin))
		(scatter Yaxis Pup_NI1_med if Yaxis==17, sort msym(circle_hollow) mc(black))
		
		(rspike Pup_NT0_10_H1_N0_M0_hi Pup_NT0_10_H1_N0_M0_lo Yaxis if Yaxis==14, horiz sort blc(black) blw(thin))
		(scatter Yaxis Pup_NT0_10_H1_N0_M0_med if Yaxis==14, sort msym(circle_hollow) mc(black))
		
		(rspike Pup_NT0_10_H0_N1_M0_hi Pup_NT0_10_H0_N1_M0_lo Yaxis if Yaxis==13, horiz sort blc(black) blw(thin))
		(scatter Yaxis Pup_NT0_10_H0_N1_M0_med if Yaxis==13, sort msym(circle_hollow) mc(black))
		
		(rspike Pup_NT0_01_H1_N0_M0_hi Pup_NT0_01_H1_N0_M0_lo Yaxis if Yaxis==10, horiz sort blc(black) blw(thin))
		(scatter Yaxis Pup_NT0_01_H1_N0_M0_med if Yaxis==10, sort msym(circle_hollow) mc(black))
		
		(rspike Pup_NT0_01_H0_N1_M0_hi Pup_NT0_01_H0_N1_M0_lo Yaxis if Yaxis==9, horiz sort blc(black) blw(thin))
		(scatter Yaxis Pup_NT0_01_H0_N1_M0_med if Yaxis==9, sort msym(circle_hollow) mc(black))
		
		(rspike Pup_NT1_10_H1_N0_M0_hi Pup_NT1_10_H1_N0_M0_lo Yaxis if Yaxis==6, horiz sort blc(black) blw(thin))
		(scatter Yaxis Pup_NT1_10_H1_N0_M0_med if Yaxis==6, sort msym(circle_hollow) mc(black))
		
		(rspike Pup_NT1_10_H0_N1_M0_hi Pup_NT1_10_H0_N1_M0_lo Yaxis if Yaxis==5, horiz sort blc(black) blw(thin))
		(scatter Yaxis Pup_NT1_10_H0_N1_M0_med if Yaxis==5, sort msym(circle_hollow) mc(black))
		
		(rspike Pup_NT1_01_H1_N0_M0_hi Pup_NT1_01_H1_N0_M0_lo Yaxis if Yaxis==2, horiz sort blc(black) blw(thin))
		(scatter Yaxis Pup_NT1_01_H1_N0_M0_med if Yaxis==2, sort msym(circle_hollow) mc(black))
		
		(rspike Pup_NT1_01_H0_N1_M0_hi Pup_NT1_01_H0_N1_M0_lo Yaxis if Yaxis==1, horiz sort blc(black) blw(thin))
		(scatter Yaxis Pup_NT1_01_H0_N1_M0_med if Yaxis==1, sort msym(circle_hollow) mc(black))
		
		,
		yline(16, lc(gs10) lw(medium))
		yline(12, lc(gs10) lw(medium))
		yline(8, lc(gs10) lw(medium))
		yline(4, lc(gs10) lw(medium))
		ytitle("")
		xtitle("Predicted Probabiltiy")
		legend(off)
		scheme(s1mono)
	name(probs, replace);		

*also graph the differences for further inference:
#delimit ;
twoway 	(rspike Dup_NT10_lo Dup_NT10_hi	Yaxis if Yaxis==18, horiz sort blc(black) blw(thin))
		(scatter Yaxis Dup_NT10_med if Yaxis==18, sort msym(circle_hollow) mc(black))
		
		(rspike Dup_NI10_lo Dup_NI10_hi	Yaxis if Yaxis==17, horiz sort blc(black) blw(thin))
		(scatter Yaxis Dup_NI10_med if Yaxis==17, sort msym(circle_hollow) mc(black))
		
		(rspike Dup_OT10_HR_lo Dup_OT10_HR_hi Yaxis if Yaxis==14, horiz sort blc(black) blw(thin))
		(scatter Yaxis Dup_OT10_HR_med if Yaxis==14, sort msym(circle_hollow) mc(black))
		
		(rspike Dup_OT10_N_lo Dup_OT10_N_hi Yaxis if Yaxis==13, horiz sort blc(black) blw(thin))
		(scatter Yaxis Dup_OT10_N_med if Yaxis==13, sort msym(circle_hollow) mc(black))
		
		(rspike Dup_OI10_HR_lo Dup_OI10_HR_hi Yaxis if Yaxis==10, horiz sort blc(black) blw(thin))
		(scatter Yaxis Dup_OI10_HR_med if Yaxis==10, sort msym(circle_hollow) mc(black))
		
		(rspike Dup_OI10_N_lo Dup_OI10_N_hi Yaxis if Yaxis==9, horiz sort blc(black) blw(thin))
		(scatter Yaxis Dup_OI10_N_med if Yaxis==9, sort msym(circle_hollow) mc(black))
		
		(rspike Dup_OT10_HR_lo Dup_OT10_HR_hi Yaxis if Yaxis==6, horiz sort blc(black) blw(thin))
		(scatter Yaxis Dup_OT10_HR_med if Yaxis==6, sort msym(circle_hollow) mc(black))
		
		(rspike Dup_OT10_N_lo Dup_OT10_N_hi Yaxis if Yaxis==5, horiz sort blc(black) blw(thin))
		(scatter Yaxis Dup_OT10_N_med if Yaxis==5, sort msym(circle_hollow) mc(black))
		
		(rspike Dup_OI10_HR_lo Dup_OI10_HR_hi Yaxis if Yaxis==2, horiz sort blc(black) blw(thin))
		(scatter Yaxis Dup_OT10_HR_med if Yaxis==2, sort msym(circle_hollow) mc(black))
		
		(rspike Dup_OI10_N_lo Dup_OI10_N_hi Yaxis if Yaxis==1, horiz sort blc(black) blw(thin))
		(scatter Yaxis Dup_OI10_N_med if Yaxis==1, sort msym(circle_hollow) mc(black))
		,
		yline(16, lc(gs10) lw(medium))
		yline(12, lc(gs10) lw(medium))
		yline(8, lc(gs10) lw(medium))
		yline(4, lc(gs10) lw(medium))
		ytick(0(1)18) ylabel(none) ytitle("")
		xline(0, lc(black) lp(dash) lw(medium))
		xtitle("Difference from Baseline")
		legend(off)
		scheme(s1mono)
	name(diffs, replace)	;

*Combine the two plots together:		
#delimit ;
graph combine probs diffs, rows(1) ycommon
		title("Fig A9. Predicted Probabilities and Differences for Increase in Events", size(medium))
	note("NOTE: Left panel plots median predicted probabilities from simulated sampling distribution of 100,000 estimates at each sanction status. Black"
		"spikes provide span between 2.5th and 97.5th percentiles of the distribution.Shaded grey bars indicate the relevant baseline category for comp-"
		"arison.In the upper three sets of probabilities, the baseline is a country with neither new nor ongoing sanction episodes; in the lower two, a case"
		"with a new threat but no ongoing episodes.The right panel plots median differences, and their confidence bounds, between the probabilities"
		"when the sanction status obtains and the baseline.A difference is statistically significant at .05 level if its spike does not overlap with zero (marked" 
		"by black dashed line).All other covariates held to mean/mode for calculation of probabilities.", size(vsmall) span)
	scheme(s1mono)
	name(figa9, replace)
	saving(Graphs/FigA9.gph, replace);
#delimit cr


*This completes the replication process.
log close
